package com.googlecode.allinclusive.fw.core.converter;

import java.util.HashMap;
import java.util.Map;

@SuppressWarnings({"rawtypes", "unchecked"})
public class ConverterRegistry {

	private static final Map<Class<Object>, Converter> converterMap = new HashMap<Class<Object>, Converter>();
	
	static {
		register(String.class, new StringConverter());
		register(Long.class, new LongConverter());
	}
	
	public static void register(Class clazz, Converter converter) {
		converterMap.put(clazz, converter);
	}
	
	public static Converter lookup(Class clazz) {
		return converterMap.get(clazz);
	}
}
